package com.espressif.iot.db.greenrobot.daos;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.espressif.iot.db.greenrobot.daos.UserDB;
import com.espressif.iot.db.greenrobot.daos.DeviceDB;
import com.espressif.iot.db.greenrobot.daos.ApDB;
import com.espressif.iot.db.greenrobot.daos.DownloadIdValueDB;
import com.espressif.iot.db.greenrobot.daos.GenericDataDirectoryDB;
import com.espressif.iot.db.greenrobot.daos.GenericDataDB;

import com.espressif.iot.db.greenrobot.daos.UserDBDao;
import com.espressif.iot.db.greenrobot.daos.DeviceDBDao;
import com.espressif.iot.db.greenrobot.daos.ApDBDao;
import com.espressif.iot.db.greenrobot.daos.DownloadIdValueDBDao;
import com.espressif.iot.db.greenrobot.daos.GenericDataDirectoryDBDao;
import com.espressif.iot.db.greenrobot.daos.GenericDataDBDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession
{
    
    private final DaoConfig userDBDaoConfig;
    
    private final DaoConfig deviceDBDaoConfig;
    
    private final DaoConfig apDBDaoConfig;
    
    private final DaoConfig downloadIdValueDBDaoConfig;
    
    private final DaoConfig genericDataDirectoryDBDaoConfig;
    
    private final DaoConfig genericDataDBDaoConfig;
    
    private final UserDBDao userDBDao;
    
    private final DeviceDBDao deviceDBDao;
    
    private final ApDBDao apDBDao;
    
    private final DownloadIdValueDBDao downloadIdValueDBDao;
    
    private final GenericDataDirectoryDBDao genericDataDirectoryDBDao;
    
    private final GenericDataDBDao genericDataDBDao;
    
    private final DaoConfig xqzoneDBDaoConfig;
    private final XqzoneDBDao xqzoneDBDao;
    
    public DaoSession(SQLiteDatabase db, IdentityScopeType type,
        Map<Class<? extends AbstractDao<?, ?>>, DaoConfig> daoConfigMap)
    {
        super(db);
        
        userDBDaoConfig = daoConfigMap.get(UserDBDao.class).clone();
        userDBDaoConfig.initIdentityScope(type);
        
        deviceDBDaoConfig = daoConfigMap.get(DeviceDBDao.class).clone();
        deviceDBDaoConfig.initIdentityScope(type);
        
        apDBDaoConfig = daoConfigMap.get(ApDBDao.class).clone();
        apDBDaoConfig.initIdentityScope(type);
        
        downloadIdValueDBDaoConfig = daoConfigMap.get(DownloadIdValueDBDao.class).clone();
        downloadIdValueDBDaoConfig.initIdentityScope(type);
        
        genericDataDirectoryDBDaoConfig = daoConfigMap.get(GenericDataDirectoryDBDao.class).clone();
        genericDataDirectoryDBDaoConfig.initIdentityScope(type);
        
        genericDataDBDaoConfig = daoConfigMap.get(GenericDataDBDao.class).clone();
        genericDataDBDaoConfig.initIdentityScope(type);
        
        userDBDao = new UserDBDao(userDBDaoConfig, this);
        deviceDBDao = new DeviceDBDao(deviceDBDaoConfig, this);
        apDBDao = new ApDBDao(apDBDaoConfig, this);
        downloadIdValueDBDao = new DownloadIdValueDBDao(downloadIdValueDBDaoConfig, this);
        genericDataDirectoryDBDao = new GenericDataDirectoryDBDao(genericDataDirectoryDBDaoConfig, this);
        genericDataDBDao = new GenericDataDBDao(genericDataDBDaoConfig, this);
        
        xqzoneDBDaoConfig = daoConfigMap.get(XqzoneDBDao.class).clone();
        xqzoneDBDao = new XqzoneDBDao(xqzoneDBDaoConfig, this);
        
        registerDao(UserDB.class, userDBDao);
        registerDao(DeviceDB.class, deviceDBDao);
        registerDao(ApDB.class, apDBDao);
        registerDao(DownloadIdValueDB.class, downloadIdValueDBDao);
        registerDao(GenericDataDirectoryDB.class, genericDataDirectoryDBDao);
        registerDao(GenericDataDB.class, genericDataDBDao);
        registerDao(XqzoneDB.class, xqzoneDBDao);
    }
    
    public void clear()
    {
        userDBDaoConfig.getIdentityScope().clear();
        deviceDBDaoConfig.getIdentityScope().clear();
        apDBDaoConfig.getIdentityScope().clear();
        downloadIdValueDBDaoConfig.getIdentityScope().clear();
        genericDataDirectoryDBDaoConfig.getIdentityScope().clear();
        genericDataDBDaoConfig.getIdentityScope().clear();
        
        xqzoneDBDaoConfig.getIdentityScope().clear();
    }
    
    public UserDBDao getUserDBDao()
    {
        return userDBDao;
    }
    
    public DeviceDBDao getDeviceDBDao()
    {
        return deviceDBDao;
    }
    
    public ApDBDao getApDBDao()
    {
        return apDBDao;
    }
    
    public DownloadIdValueDBDao getDownloadIdValueDBDao()
    {
        return downloadIdValueDBDao;
    }
    
    public GenericDataDirectoryDBDao getGenericDataDirectoryDBDao()
    {
        return genericDataDirectoryDBDao;
    }
    
    public GenericDataDBDao getGenericDataDBDao()
    {
        return genericDataDBDao;
    }

	public XqzoneDBDao getXqzoneDBDao() {
		// TODO Auto-generated method stub
		return xqzoneDBDao;
	}
    
}
